package com.dly.hope.workflow;

import com.dly.hope.modle.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
* @Name: ConditionInfo
* @Description:  条件定义信息
* @Author: Danny Chen
* @Date: 2022/1/18
*/
@Entity
@Table(name = "wfl004_condition_info")
@Data
@DynamicInsert
@DynamicUpdate
public class ConditionInfo extends BaseEntity {

    @Id
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(generator = "uuid")
    @Column(name = "id", nullable = false)
    private String id;

    /**
     * 条件名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 流程ID
     */
    @Column(name = "process_id")
    private String processId;

    /**
     * 条件表达式，最终计算出Boolean类型的值
     */
    @Column(name = "expression")
    private String expression;

    /**
     * 满足条件后跳转的节点ID
     */
    @Column(name = "goto_node_id")
    private String gotoNodeId;

    /**
     * 序号，在展示的时候用于排序，在审批筛选出多个条件时确定优先执行条件
     */
    @Column(name = "seq_no")
    private Integer seqNo;

    /**
     * 满足条件后调用的API
     */
    //@Column(name = "event_api")
    //private String eventApi;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

}
